﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace AccountsPayable
{
    public abstract class TaxEntity
    {
        private String taxId;

        protected TaxEntity() { }

        public TaxEntity(string taxId)
        {
            TaxId = taxId;
        }

        public string TaxId
        {
            set
            {
                if (value != null && Regex.IsMatch(value, TaxIdRegex))
                {
                    taxId = value;
                }
                else
                    throw new ArgumentException();
            }
            get { return taxId; }
        }

        protected abstract string TaxIdRegex
        {
            get;
        }

        public abstract float Pay();

    }
}
